Skip to content

Add ScaleControl to the map for metric unit display#71

Open
AdeelTahir-SE wants to merge 2 commits intoopenzim:mainfrom
AdeelTahir-SE:scale-length
Open

Add ScaleControl to the map for metric unit display#71
AdeelTahir-SE wants to merge 2 commits intoopenzim:mainfrom
AdeelTahir-SE:scale-length

Conversation

@AdeelTahir-SE
Copy link
Copy Markdown

@AdeelTahir-SE AdeelTahir-SE commented Mar 25, 2026

What did:
Added a persistent map length scale to the UI so users can always estimate real world distance at the current zoom level. fixes #46

What changed:
Added MapLibre’s built-in ScaleControl to the map.
Placed the scale at the bottom-right so it stays visible at all times.
Kept the implementation minimal and focused (single JS change).

Copy link
Copy Markdown
Collaborator

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please:

  • add a changelog entry
  • link the PR to the issue
  • share a screenshot so that participants can comment on the result without needing to re-create a ZIM on their own (most don't want to loose time on this, and I'm not sure issue author is even able to do that)

…d8bbwe\TempState\Recordings\20260327-1120-01.6980157.mp4
@AdeelTahir-SE
Copy link
Copy Markdown
Author

the scale control has been successfully added to the map.
It is displayed at the bottom-right corner and shows metric units as expected.
A short video and screenshot have been attached to demonstrate its appearance and functionality.

Recording.2026-03-27.162031.mp4
Screenshot 2026-03-27 161938

@benoit74
Copy link
Copy Markdown
Collaborator

@sga-13 would this match what you expect?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Display a length scale on the map

2 participants